CC=g++ -D DEBUG
CFLAGS=-O3 -funroll-loops -c
LDFLAGS=-O2 -lm
#SOURCES=Bot.cc MyBot.cc State.cc Order.cc Bfs.cc Simulator.cc Spread.cc 
SOURCES=Location.cc State.cc Order.cc Strategy.cc Bot.cc MyBot.cc 
OBJECTS=$(SOURCES:.cc=.o)
EXECUTABLE=MyBot

#Uncomment the following to enable debugging
#CFLAGS+=-g -DDEBUG

all: $(OBJECTS) $(EXECUTABLE)

$(EXECUTABLE): $(OBJECTS)
	$(CC) $(LDFLAGS) $(OBJECTS) -o $@

.cc.o: *.h
	$(CC) $(CFLAGS) $< -o $@

%: %.cc $(OBJECTS)
	$(CC) $(LDLAGS) $< -o $@


clean: 
	-rm -f ${EXECUTABLE} ${OBJECTS} *.d
	-rm -f debug.txt
	-rm -f *.o
	-rm -f *~

zip: clean
	-rm -f *.zip
	zip search_and_destroy.zip *


.PHONY: all clean zip


